﻿namespace Letter.Net.Kcp;

public sealed class KcpTransportOptions : ITransportOptions
{
    public int seed = 0;
    public KcpMode mode = KcpMode.STREAM;
    public KcpDelay delay = KcpDelay.fast3;
}

public sealed class KcpDelay
{
    public static readonly KcpDelay Normal = new KcpDelay( 0, 40, 2, 1);
    public static readonly KcpDelay fast1 = new KcpDelay(0, 30, 2, 1);
    public static readonly KcpDelay fast2 = new KcpDelay(1, 20, 2, 1);
    public static readonly KcpDelay fast3 = new KcpDelay(1, 10, 2, 1);

    public KcpDelay(int nodelay, int interval, int resend, int nc)
    {
        this.nodelay = nodelay;
        this.interval = interval;
        this.resend = resend;
        this.nc = nc;
    }

    public readonly int nodelay;
    public readonly int interval;
    public readonly int resend;
    public readonly int nc;
}

public enum KcpMode
{
    PACKAGE,
    STREAM
}